﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp9
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请选择要执行运算方法前的序号：1、圆形面积 2、正方形面积");
            int key = int.Parse(Console.ReadLine());

            Console.WriteLine("请输入要计算的半径或边长：");
            double num1 = double.Parse(Console.ReadLine());

            Shape tx;
            switch (key)
            {
                case 1:
                    tx = new Yuanxing();
                    break;
                case 2:
                    tx = new Zhengfangxing();
                    break;
                default:
                    Console.WriteLine("请慎重选择！！");
                    tx = new Yuanxing();
                    break;
            }
            Sele(tx, num1);
            Console.ReadKey();
        }
        static void Sele(Shape tx, double num1)
        {
            tx.GetArea(num1);
        }

    }
 }

